<?php

class Resultset
{
	private $Result;
	private $Connection;
	
	public function __construct($SqlString, $Connection)
	{
		Debug::Query($SqlString);
		$this->Connection = $Connection;
		
		$this->Result = @mysql_query($SqlString, $this->Connection) or die('MySQL Error: ' . $SqlString);
	}
	
	public function Free()
	{
		return @mysql_free_result($this->Result);
	}
	
	public function Count()
	{
		return @mysql_num_rows($this->Result);
	}
	
	public function Fetch()
	{
		return @mysql_fetch_assoc($this->Result);
	}
	
	public function FetchAll()
	{
		while ($Row = $this->Fetch())
		{
			$Rows[] = $Row;
		}
		
		return $Rows;
	}
}